package com.lanou3g.musicenjoy.utils;

import android.util.Log;

import com.lanou3g.musicenjoy.entity.Mp3Info;

import java.util.Comparator;


/**
 * @author Mr.Z
 */
public class PinyinComparator implements Comparator<Mp3Info> {

    @Override
    public int compare(Mp3Info o1, Mp3Info o2) {

        if ("@".equals(o1.getSortLetters()) || "#".equals(o2.getSortLetters())) {
            return -1;
        } else if ("#".equals(o1.getSortLetters()) || "@".equals(o2.getSortLetters())) {
            return 1;
        } else {

            if (o1.getSortLetters() == null) {
                Log.i("Sysout", "o1 = null");
            }
            if (o2.getSortLetters() == null) {
                Log.i("Sysout", "o2 = null");
            }
            return o1.getSortLetters().compareTo(o2.getSortLetters());

        }


    }

}
